<script>
  /* setTimeout(() => {
    // #1
    console.log(1);
    new Promise(() => {

    }).then(r => {
      console.log(r)
    })
  });

  Promise.resolve().then(() => {
    // #2
    console.log(2);
  }).then(() => {
    // #4
    console.log(33)
  });

  Promise.resolve().then(() => {
    // #3
    console.log(4);
  });
  console.log(3); */


  Promise.reject(233).catch(r => {
    console.log(r)
    // return Promise.resolve(undefined)
  }).then(r => {
    console.log(r)
  }).finally(r => {
    console.log(r)
  }).then(r => {
    console.log(r, 123)
  })
</script>